home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr47
/
wasm223.zip
/
SMUTTEST.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-05-04
|
1KB
|
41 lines
;Test program in SMUT by D. E. Johnson
;Simple Macro-Using Translator
include 'smut.inc' ;compiler code
expand- ;don't show assembly
n dw 0 ;variables
fact dw 0
sqr dw 0
n1 dw 0
n2 dw 0
quo dw 0
dif dw 0
exp dw 0
START ;execution begins here
DISPLAY '\This program tests a SMUT compiler'
LET n,1 ;n=1
LET fact,n ;fact=n
DISPLAY '\Num Square'
REPEAT
LET sqr,n,TIMES,n ;sqr=n*n
LET fact,fact,TIMES,n ;fact=fact*n
DISPLAY '\ '
OUTPUT n,sqr,fact
DISPLAY '=!'
LET n,n,PLUS,1 ;n=n+1
UNTIL fact,GT,32767,divby,n ;til max fact
REPEAT
DISPLAY '\Enter a positive number (& space): '
INPUT n1
DISPLAY ' and a second positive number: '
INPUT n2
LET quo,n1,DIVBY,n2
LET dif,n1,MINUS,n2
LET exp,dif,MINUS,4,TIMES,quo,PLUS,quo,MINUS,n1
DISPLAY '\Meaningless Results = '
OUTPUT n2,dif,quo,exp
UNTIL exp,LE,n2,DIVBY,3,MINUS,4
DISPLAY '\The test is completed!\'
STOP